/**
 * 
 * 2014-6-11
 */
package com.thinkgem.jeesite.common.pojo.serials.mapper.xml;

import com.thinkgem.jeesite.common.pojo.serials.mapper.obj.ObjSerialize;


public class XmlSerialize extends ObjSerialize {

	public static void main(String[] args) { 
		XmlSerialize ser = new XmlSerialize(); 
        ser.serializeToXml(); 
        ser.deSerializeFromXml(); 
    } 
    public void serializeToXml(){ 
        //Person[] myPersons = new Person[2]; 
        //myPersons[0] = new Person("Jay", 24); 
        //myPersons[1] = new Person("Tom", 23); 

        //XStream xStream = new XStream();
        //xStream.alias("Person", Person.class); 
        try{ 
            //FileOutputStream foStream = new FileOutputStream("E:\\persons.xml"); 
            //xStream.toXML(myPersons,foStream); 
        }catch(Exception e){ 
            e.printStackTrace(); 
        } 
    } 
    public void deSerializeFromXml(){ 
        //XStream xStream = new XStream(); 
        //xStream.alias("Person", Person.class); 
        //Person[] myPersons = null; 
        try{ 
            //FileInputStream flStream = new FileInputStream("E:\\persons.xml"); 
            //myPersons = (Person[])xStream.fromXML(flStream); 
            //if(myPersons!=null){ 
//                for(Person person:myPersons){ 
//                    System.out.println(person.getName()); 
//                    System.out.println(person.getAge()); 
//                } 
//            } 
        }catch(Exception e){ 
            e.printStackTrace(); 
        } 
    } 

}
